package com.cxx.purchasecharge.dal;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import com.cxx.purchasecharge.core.model.persistence.Customer;
import com.cxx.purchasecharge.dal.common.GenericCRUDDao;

@Transactional
public interface CustomerDao extends GenericCRUDDao <Customer, Long>, CustomerDaoPlus
{
    @Query (value = "select c from Customer c where c.shortName=?1")
    public Customer findByShortName (String shortName);

    @Modifying
    @Query ("update Customer c set c.dealMoney = ?1 where c.id = ?2")
    public int updateDealMoney (float dealMoney, long id);

}
